package com.ruoyi.jjyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jjyh.mapper.JjyhOrderGoodsMapper;
import com.ruoyi.jjyh.domain.JjyhOrderGoods;
import com.ruoyi.jjyh.service.IJjyhOrderGoodsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 订单商品表Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-25
 */
@Service
public class JjyhOrderGoodsServiceImpl implements IJjyhOrderGoodsService 
{
    @Autowired
    private JjyhOrderGoodsMapper jjyhOrderGoodsMapper;

    /**
     * 查询订单商品表
     * 
     * @param id 订单商品表ID
     * @return 订单商品表
     */
    @Override
    public JjyhOrderGoods selectJjyhOrderGoodsById(String id)
    {
        return jjyhOrderGoodsMapper.selectJjyhOrderGoodsById(id);
    }

    /**
     * 查询订单商品表列表
     * 
     * @param jjyhOrderGoods 订单商品表
     * @return 订单商品表
     */
    @Override
    public List<JjyhOrderGoods> selectJjyhOrderGoodsList(JjyhOrderGoods jjyhOrderGoods)
    {
        return jjyhOrderGoodsMapper.selectJjyhOrderGoodsList(jjyhOrderGoods);
    }

    @Override
    public List<JjyhOrderGoods> selectOrderGoodsList(JjyhOrderGoods jjyhOrderGoods)
    {
        return jjyhOrderGoodsMapper.selectOrderGoodsList(jjyhOrderGoods);
    }

    /**
     * 新增订单商品表
     * 
     * @param jjyhOrderGoods 订单商品表
     * @return 结果
     */
    @Override
    public int insertJjyhOrderGoods(JjyhOrderGoods jjyhOrderGoods)
    {
        jjyhOrderGoods.setCreateTime(DateUtils.getNowDate());
        return jjyhOrderGoodsMapper.insertJjyhOrderGoods(jjyhOrderGoods);
    }

    /**
     * 修改订单商品表
     * 
     * @param jjyhOrderGoods 订单商品表
     * @return 结果
     */
    @Override
    public int updateJjyhOrderGoods(JjyhOrderGoods jjyhOrderGoods)
    {
        return jjyhOrderGoodsMapper.updateJjyhOrderGoods(jjyhOrderGoods);
    }

    /**
     * 删除订单商品表对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJjyhOrderGoodsByIds(String ids)
    {
        return jjyhOrderGoodsMapper.deleteJjyhOrderGoodsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单商品表信息
     * 
     * @param id 订单商品表ID
     * @return 结果
     */
    @Override
    public int deleteJjyhOrderGoodsById(String id)
    {
        return jjyhOrderGoodsMapper.deleteJjyhOrderGoodsById(id);
    }
}
